package com.kunyi.web.service.file.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @ClassName FileDriverTypeEnum
 * @Description 仓库类型
 * @Author pengjunjun
 * @Date 2024/03/04
 * @Version 1.0
 **/
@Getter
@AllArgsConstructor
public enum KunyiRepositoryTypeEnum {
    OSS("oss", "阿里云",0),
    COS("cos", "腾讯云",1),
    OBS("obs", "华为云",2),
    KODE("kode","七牛云",3),
    MINIO("minio","MINIO",4),
    BOS("bos", "百度云",5),
    LOCAL("local","本地",6)
    ;
    private String code;
    private String message;
    private Integer value;
    /**
     * @author: zhenguo.zhuang
     * @Description 根据value获取code
     * @Date 17:37 2024/3/13
     * @Param value:
     * @return String
     **/
    public static String getCode(Integer value){
        String code=null;
        for (KunyiRepositoryTypeEnum kunyiRepositoryTypeEnum : KunyiRepositoryTypeEnum.values()) {
            if (kunyiRepositoryTypeEnum.getValue().equals(value)){
                code=kunyiRepositoryTypeEnum.getCode();
                break;
            }
        }
        return code;
    }

}
